<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网上商城</title>
    <link rel="stylesheet" th:href="@{~/bootstrap/css/bootstrap.min.css}">
    <script th:src="@{~/js/jquery-3.2.1.min.js}"></script>
</head>
<body>
    <div class="container">
        <table class="table table-striped">
           <thead>
                <tr>
                    <td>编号</td>
                    <td>名称</td>
                    <td>上传时间</td>
                    <td>类别</td>
                    <td>价格</td>
                    <td>图片</td>
                    <td>操作</td>
                </tr>
           </thead>
           <tbody>
            <tr th:each="goods : ${goodsList}">
                <td th:text="${goods.id}">001</td>
                <td th:text="${goods.goodsname}">旺仔牛奶</td>
                <td th:text="${#dates.format(goods.uptime,'yyyy-MM-dd')}">2019-5-9</td>
                <td th:text="${goods.type.tname}">奶制品</td>
                <td th:text="${goods.price}">6.0</td>
                <td>
                    <span>
                        <img width="30" height="30" th:src="@{/img/{img}(img=${goods.img})}" alt="" class="img-circle">
                    </span>
                </td>
                <td>
                    <a th:href="@{/goods/updateGoods/{id}(id=${goods.id})}">修改</a>
                </td>
            </tr>
            <tfoot>
            <nav aria-label="Page navigation">
                <ul class="pagination">
                    <li>
                        <a th:href="@{/goods/allgoods(current=${current - 1==0?1:current - 1})}" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li th:attr="class=${current == num?'active':''}" th:each="num : ${#numbers.sequence(1,page)}">
                        <a th:href="@{/goods/allgoods(current=${num})}" th:text="${num}">1</a>
                    </li>
                    <li>
                        <a th:href="@{/goods/allgoods(current=${current + 1>page?page:current + 1})}" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
            </tfoot>
           </tbody>
        </table>
    </div>
</body>
</html>